<?php
$ci = &get_instance();
$ci->load->model("Docente_Model");
if  (!isset($recargo)) {
    $recargo = 0.00;
    $recargo2=0.00;
    $recargo = round(($inscrito[0]['tipo_matr'] == 1 ? 0 : ($inscrito[0]['tipo_matr'] == 2 ? ($costo_lec * 0.1) : ($costo_lec * 0.2) )), 2);
}
?>
<!-- <div id="example" class="modal span5 fade">
    <div class="modal-header">
        <a data-dismiss="modal" class="close">×</a>
        <h3>Cabecera de la ventana</h3>
     </div>
     <div class="modal-body">
  -->

    <form name="forma" class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/pagotodos/ingresodatos" ?>" method="post" >


        <legend>PROCESAR DATOS DE LA MATRICULACION</legend>

        <div class="tabbable">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#1" data-toggle="tab">Datos Generales</a></li>
                <li><a href="#2" data-toggle="tab">Datos Matriculaci&oacute;n</a></li>
                <li ><a href="#3" data-toggle="tab">Control de Pagos</a></li>
            </ul>
            <div class="tab-content">
                <?php foreach ($estudiante as $i => $est) { ?>
                    <div class="tab-pane active" id="1">
                        <div class="control-group">
                            <label class="control-label" for="input01">N&uacute;mero de Identificaci&oacute;</label>
                            <div class="controls">
                                <input type="text" class="input-medium span2"  name="cedula_pers" value= "<?php echo $est['cedula_pers']; ?>">

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="select01">Tipo de Documento</label>
                            <div class="controls">

                                <select id="select01"  name="tipo_doc_pers">

                                    <option value= "0" <?php echo ($est['tipo_doc_pers'] == 0 ? " selected" : " "); ?>>CEDULA</option>
                                    <option value= "1" <?php echo ($est['tipo_doc_pers'] == 1 ? " selected" : " "); ?>>PASAPORTE</option>
                                    <option value= "2" <?php echo ($est['tipo_doc_pers'] == 2 ? " selected" : " "); ?>>CARNE DE REFUGIADO</option>
                                </select>

                            </div>
                        </div>


                        <div class="control-group">
                            <label class="control-label" for="input02">Nombre Completos</label>
                            <div class="controls">
                                <input type="text" class="input-medium span4"  name="nombre_pers" value= "<?php echo $est['nombre_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input03">Apellidos </label>
                            <div class="controls">
                                <input type="text" class="input-medium span4"  name="apellido_pers" value= "<?php echo $est['apellido_pers']; ?>">
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input04">Nacionalidad </label>
                            <div class="controls">
                                <input type="text" class="input-medium span3"  name="nacionalidad_pers" value= "<?php echo $est['nacionalidad_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input15">Provincia </label>
                            <div class="controls">
                                <input type="text" class="input-medium span3"  name="provincia_pers" value= "<?php echo $est['provincia_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input05">Ciudad </label>
                            <div class="controls">
                                <input type="text" class="input-medium span3"  name="ciudad_pers" value= "<?php echo $est['ciudad_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input06">Direccion del Domicilio</label>
                            <div class="controls">
                                <input type="text" class="input-medium span4"  name="direccion_pers" value= "<?php echo $est['direccion_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input07">Referencia del Domicilio</label>
                            <div class="controls">
                                <input type="text" class="input-medium span4"  name="refer_domic_pers" value= "<?php echo $est['refer_domic_pers']; ?>">

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input08">Tipo de Discapacidad</label>
                            <div class="controls">
                                <input type="text" class="input-medium span4"  name="tipo_discap_pers" value= "<?php echo $est['tipo_discap_pers']; ?>">

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input09">Carn&eacute; del CONADIS</label>
                            <div class="controls">
                                <input type="text" class="input-medium span3"  name="conadis_pers" value= "<?php echo $est['conadis_pers']; ?>">

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input010">Porcentaje de Discapacidad</label>
                            <div class="controls">
                                <input type="text" class="input-medium span2"  name="porc_disc_pers" value= "<?php echo $est['porc_disc_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="select01">Sexo</label>
                            <div class="controls">

                                <select id="select01"  name="sexo_pers">
                                    <option <?php echo ($est['sexo_pers'] == "HOMBRE" ? " selected" : " "); ?>>HOMBRE</option>
                                    <option <?php echo ($est['sexo_pers'] == "MUJER" ? " selected" : " "); ?>>MUJER</option>
                                </select>

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="select02">Estado Civil</label>
                            <div class="controls">

                                <select id="select02"  name="estado_civil_pers">
                                    <option <?php echo ($est['estado_civil_pers'] == "SOLTERO(A)" ? " selected" : " "); ?>>SOLTERO(A)</option>
                                    <option <?php echo ($est['estado_civil_pers'] == "CASADO(A)" ? " selected" : " "); ?>>CASADO(A)</option>
                                    <option <?php echo ($est['estado_civil_pers'] == "UNION LIBRE" ? " selected" : " "); ?>>UNION LIBRE</option>
                                    <option <?php echo ($est['estado_civil_pers'] == "DIVORCIADO(A)" ? " selected" : " "); ?>>DIVORCIADO(A)</option>
                                    <option <?php echo ($est['estado_civil_pers'] == "VIUDO(A)" ? " selected" : " "); ?>>VIUDO(A)</option>
                                    <option <?php echo ($est['estado_civil_pers'] == "ECLECIASTICO(A)" ? " selected" : " "); ?>>ECLECIASTICO(A)</option>


                                </select>

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="select12">Autodefinici&oacute;</label>
                            <div class="controls">

                                <select id="select02"  name="autodefin_pers">
                                    <option <?php echo ($est['autodefin_pers'] == "NEGRO" ? " selected" : " "); ?>>NEGRO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "MULATO" ? " selected" : " "); ?>>MULATO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "AFROECUATORIANO" ? " selected" : " "); ?>>AFROECUATORIANO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "INDIGENA" ? " selected" : " "); ?>>INDIGENA</option>
                                    <option <?php echo ($est['autodefin_pers'] == "MESTIZO" ? " selected" : " "); ?>>MESTIZO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "MONTUBIO" ? " selected" : " "); ?>>MONTUBIO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "BLANCO" ? " selected" : " "); ?>>BLANCO</option>
                                    <option <?php echo ($est['autodefin_pers'] == "OTRO" ? " selected" : " "); ?>>OTRO</option>


                                </select>

                            </div>
                        </div>


                        <div class="control-group">
                            <label class="control-label" for="select03">Fecha de Nacimiento</label>
                            <div class="controls">
                                <input type="text" class="input-medium "  name="fecha_nac_pers" value="<?php echo date("m/d/Y", strtotime($est['fecha_nac_pers'])); ?>">

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input08">N&uacute;mero de tel&eacute;fono</label>
                            <div class="controls">
                                <input type="text" class="input-medium span2"  name="fono_pers" value= "<?php echo $est['fono_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input09">N&uacute;mero de celular</label>
                            <div class="controls">
                                <input type="text" class="input-medium span2"  name="celular_pers" value= "<?php echo $est['celular_pers']; ?>">

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input10">Correo Electr&oacute;nico Institucional</label>
                            <div class="controls">
                                <input type="text" class="input-medium span3"  name="email_inst_pers" value= "<?php echo $est['email_inst_pers']; ?>">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input11">Fotograf&iacute;a</label>
                            <div class="controls">
                                <img src="<?php echo $est['foto_pers']; ?>" width="88" height="99" alt="itss1"/>
                            </div>
                        </div>



                    </div>
                <?php } ?>
                <div class="tab-pane" id="2">
                    <div class="control-group">
                        <label class="control-label" for="select01">PERIODO</label>
                        <div class="controls ">
                            <select name="ide_lec_nom" class="span3">
                                <option ><?php echo $ide_lec_nom; ?></option>
                            </select>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select03">CARRERA</label>
                        <div class="controls ">
                            <select name="ide_car" class="span3" >
                                <option ><?php echo $ide_car_nom; ?></option>
                            </select>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select03">Pensums</label>
                        <div class="controls ">
                            <select id="select02" name="ide_pen" class="span3">
                                <option ><?php echo $ide_pen_nom; ?></option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select04">Ciclo</label>
                        <div class="controls ">
                            <select id="select02" name="ide_ciclo" class="span3">

                                <option ><?php echo $ide_ciclo_nom; ?></option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select02">JORNADA DE TRABAJO</label>
                        <div class="controls ">
                            <select name="seccion" class="span3">
                                <option ><?php echo $seccion_nom; ?></option>
                            </select>


                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select02">PARALELO</label>
                        <div class="controls ">
                            <select name="paralelo" class="span1">
                                <option ><?php echo $paralelo_nom; ?></option>
                            </select>


                        </div>
                    </div>
                    <?php foreach ($inscrito as $i => $ins) { ?>


                        <div class="control-group">
                            <label class="control-label" for="select08">Fecha de la Matr&iacute;cula</label>
                            <div class="controls">

                                <input type="text" class="input-medium "  id="datepicker1" name="fecha_matr" value="<?php echo date("m/d/Y", strtotime($ins['fecha_matr'])); ?>" >

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input02">Nro. de Cupo</label>
                            <div class="controls">
                                <input type="text" class="input-medium span1"  name="cupo" value="<?php echo $nro_cup; ?>" disabled>

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input02">Nro. de Matr&iacute;cula</label>
                            <div class="controls">
                                <input type="text" class="input-medium span1"  name="nro_matr" value="<?php echo $ins['nro_matr']; ?>" disabled>

                            </div>
                        </div>


                        <div class="control-group">
                            <label class="control-label" for="input11">ESTADO </label>
                            <div class="controls">
                                <select id="estado_cur" name="estado_cur" disabled>
                                    <option value="1" <?php echo ($ins['estado_matr'] == 1 ? " selected" : " "); ?>>EN PROCESO</option>
                                    <option value="2" <?php echo ($ins['estado_matr'] == 2 ? " selected" : " "); ?>>ACEPTADA</option>
                                    <option value="3" <?php echo ($ins['estado_matr'] == 3 ? " selected" : " "); ?>>NEGADA</option>
                                    <option value="4" <?php echo ($ins['estado_matr'] == 4 ? " selected" : " "); ?>>DEVOLUCION</option>


                                </select>


                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input11">TIPO DE MATRICULA </label>
                            <div class="controls">
                                <select id="tipo_matr" name="tipo_matr" >
                                    <option value="1" <?php echo ($ins['tipo_matr'] == 1 ? " selected" : " "); ?>>ORDINARIA</option>
                                    <option value="2" <?php echo ($ins['tipo_matr'] == 2 ? " selected" : " "); ?>>EXTRAORDINARIA</option>
                                    <option value="3" <?php echo ($ins['tipo_matr'] == 3 ? " selected" : " "); ?>>ESPECIAL</option>


                                </select>


                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="textarea">OBSERVACION MATRICULA</label>
                            <div class="controls">
                                <textarea class="input-xxlarge" id="observa_cur" name="observa_cur" rows="2" value=""><?php echo $ins['observ_mat']; ?></textarea>
                                <input type="hidden" name="id_matr" value="<?php echo $ins['id_matr']; ?>">
                                <input type="hidden" name="nro_matr" value="<?php echo $ins['nro_matr']; ?>">
                                <input type="hidden" name="estado_matr" value="<?php echo $ins['estado_matr']; ?>">
                                <input type="hidden" name="ide_lec" value="<?php echo $ide_lec; ?>">
                                <input type="hidden" name="modo_mt" value="<?php echo $ins['modo_mat']; ?>">
                                
                                
                            </div>
                        </div>
                    <?php } ?>


                </div>

                <script type="text/javascript">
                    function ocultar_mostrar_doc(opc){
                        
                    var panel1 = document.getElementById("panel1");
                    var panel2 = document.getElementById("panel2");
                    var panel3 = document.getElementById("panel3");
                    var panel4 = document.getElementById("panel4");
                    var panel5 = document.getElementById("panel5");
                    var panel6 = document.getElementById("panel6");
                    var panel7 = document.getElementById("panel7");
                    opc=opc*1;
                    switch (opc) { 
                        case 1:
                            panel1.style.display='block';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 
                        case 2: 
                            panel1.style.display='nonce';
                            panel2.style.display='block';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                            
                        break 
                        case 3: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='block';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                            
                        break 
                        case 4: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='block';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 

                        case 5: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='block';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 
                        case 6: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='block';
                            panel7.style.display='none';
                        break 
                        case 7: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='block';
                        break 

                    } //fin switch
                }
                      
                    function ocultar_mostrar_fin(opc){
                        
                    var panel1 = document.getElementById("panel_pagoi1");
                    var panel2 = document.getElementById("panel_pagoi2");
                    var panel3 = document.getElementById("panel_financia");
                    var panel4 = document.getElementById("idcosto_arrastre");
                    //var panel5 = document.getElementById("idcosto_tit");
                    var panel6 = document.getElementById("panel_coutas");
                    
                    
                    
                    opc=opc*1;
                    
                    switch (opc) { 
                        case 1:  //contado
                        case 2:  //iece
                        case 3:  //becas 100
                        case 8: 
                        case 9:
                        case 10:
                            panel1.style.display='block';
                            panel4.style.display='block';
                            //panel5.style.display='block';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel6.style.display='none';
                            
                        break 
                        case 4: //beca 75
                        case 5: //beca 50
                        case 6: //beca 25
                        case 7: //finaciado
                        case 11://IECE Financiado
                            panel1.style.display='none';
                            panel4.style.display='none';
                            //panel5.style.display='none';
                            panel2.style.display='block';
                            panel3.style.display='block';
                            panel6.style.display='block';
                        break 

                    } //fin switch

                }
                function mostrar_tabla(){
                    var boton = document.getElementById("ver_tabla");
                    var tabla = document.getElementById("tablamatriculai");
                    var valor=boton.value;
                    if(valor.toLowerCase()=="mostrar"){
                        boton.value="ocultar";
                        tabla.style.display='block';
                    }else{
                        boton.value="mostrar";
                        tabla.style.display='none';
                        
                    }
                    
                }//ptitula
                function calcular_arrastres(){
                    var caja1 = document.getElementById("parrastre");
                    var caja2= document.getElementById("finan2");
                    
                    if((caja1.value*1)<(caja2.value*1)){
                        caja2.value=(caja2.value*1)-(caja1.value*1);
                        
                    }else{
                        alert("Error no se puede procesar");
                        
                    }
                    
                }
                function incre_descr(){
                    var caja1 = document.getElementById("valarrastre");
                    var caja2= document.getElementById("finan2");
                    var caja3=document.getElementById("idtipo_incre");
                    //caja1.value=caja1.value*1;
                    //caja2.value=caja2.value*1;
                    var opc =caja3.value*1;
                    //alert(caja3.value);
                     switch (opc) {
                         case 0:
                             break; //no se realiza nada
                         case 1:  //incrementar el valor
                             
                             caja2.value=(caja2.value*1)+(caja1.value*1);
                             break;
                         case 2:  //disminuir el valor
                              if((caja1.value*1)<(caja2.value*1)){
                                caja2.value=(caja2.value*1)-(caja1.value*1);;
                        
                                }else{
                                alert("Error no se puede procesar");
                        
                                }
                             break;
                                 
                 }
                }
                function calcular_titulacion(){
                    var caja1 = document.getElementById("ptitula");
                    var caja2= document.getElementById("finan3");
                    
                    if((caja1.value*1)<(caja2.value*1)){
                        caja2.value=(caja2.value*1)-(caja1.value*1);
                        
                    }else{
                        alert("Error no se puede procesar");
                        
                    }
                    
                }
                    function calculasaldo(){
                        
                    var x = document.getElementById("pago_ac").value*1;
                    var y= document.getElementById("pago_i").value*1;
                    var resta=0;
                    //if (y>=x){
                        resta=y-x;
                        
                    //}else{
                    //    alert("El valor es incorrecto ");
                    //}
                        document.getElementById("saldo").value=resta;
                }
                

                
                
                </script>


                <div class="tab-pane"  id="3">
                    <div class="control-group">
                        <label class="control-label" for="input11">MODO DE MATRICULA</label>
                        <div class="controls">
                            <select id="tipo_matr" name="modo_mat" disabled>
                                <option value="1" <?php echo ($ins['modo_mat'] == 1 ? " selected" : " "); ?>>NORMAL</option>
                                <option value="2" <?php echo ($ins['modo_mat'] == 2 ? " selected" : " "); ?>>NORMAL/ARRASTRE</option>
                                <option value="3" <?php echo ($ins['modo_mat'] == 3 ? " selected" : " "); ?>>CONVALIDACION</option>
                                <option value="4" <?php echo ($ins['modo_mat'] == 4 ? " selected" : " "); ?>>ARRASTRES</option>
                                <option value="5" <?php echo ($ins['modo_mat'] == 5 ? " selected" : " "); ?>>MATERIAS</option>
                            </select>


                        </div>
                    </div>

                        <div id="tablamatriculai" style="display: none;">
                            <table class="table table-bordered table-striped table-condensed">
                                <thead>
                                    <tr>
                                        <th>ASIGNA</th>
                                        <th>COD</th>
                                        <th>MATERIA</th>
                                        <th>CRED</th>
                                        <th>ESTADO</th>
                                        <th>VALOR</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $nro_filas = 0;
                                    $total_teoricas = 0;
                                    $total_practicas = 0;
                                    $total_teoricas_conv=0;
                                    $total_practicas_conv=0;
                                    $titulo="Convalidacion";
                                    $ver_inscrip=0;
                                    if (!empty($materias)) {
                                        $nro_filas = count($materias);
                                        foreach ($materias as $i => $mat) {
                                            ?>
                                            <tr>
                                                <td ><div centrar align="center"><i class="icon-ok"></i>
                                                        <input type="hidden" <?php echo "name='ide_mat" . $i . "' value='" . $mat['ide_mat'] . "'"; ?>>
                                                    </div></td>
                                                <td><?php echo ($mat['codigo_cic'] . "." . $mat['codigo_mat']) ?></td>
                                                <td><?php echo $mat['nombre_mat'] ?></td>
                                                <td><?php echo $mat['creditos_mat'] ?></td>
                                                <td><?php
                                                    echo ($mat['estado_cur'] == 0 ? 'ACTIVO' : ($mat['estado_cur'] == 2 ? 'PENDIENTE' :
                                                                    ($mat['estado_cur'] == 3 ? 'REPROBADO' : 
                                                                    ($mat['estado_cur'] == 4 ? 'ARRASTRE' :
                                                                    ($mat['estado_cur'] == 5 ? 'MATERIAS' : 'CICLO')))));
                                                    ?><input type="hidden" <?php echo "name='estado_cur" . $i . "' value='" . $mat['estado_cur'] . "'"; ?></td>
                                                <td >
                                                    <?php
                                                    if (($ins['modo_mat'] == 2 || $ins['modo_mat'] == 4) && ($mat['estado_cur'] == 4 ) ) { //normal con arrastres o con arrastres
                                                        if ($mat['tipomat_mat'] == 'TEORICA') {
                                                            echo($valor_teoricas * $mat['creditos_mat']." [T]");
                                                           $total_teoricas = $total_teoricas + ($valor_teoricas * $mat['creditos_mat']);
                                                        } else {
                                                            echo($valor_practicas * $mat['creditos_mat'] ." [P]");
                                                            $total_practicas = $total_practicas + ($valor_practicas * $mat['creditos_mat']);
                                                        }
                                                    } elseif($ins['modo_mat'] == 3 || $mat['estado_cur'] == 5){ // convalidacion o materias sueltas
                                                         if ($mat['tipomat_mat'] == 'TEORICA') {
                                                             if ($mat['estado_cur'] <6 ) {
                                                             echo($valor_teoricas * $mat['creditos_mat']." [T]");
                                                            $total_teoricas_conv = $total_teoricas_conv + ($valor_teoricas * $mat['creditos_mat']);
                                                                 
                                                             }
                                                        } else {
                                                             if ($mat['estado_cur'] <6 ) {
                                                            $total_practicas_conv = $total_practicas_conv + ($valor_practicas * $mat['creditos_mat']);
                                                            echo($valor_practicas * $mat['creditos_mat']." [P]");
                                                                 
                                                             }
                                                            
                                                        }
                                                        $titulo=($mat['estado_cur'] == 5?" Materias":" Convalidacion");
                                                        $ver_inscrip=($mat['estado_cur'] == 5?1:0);

                                                        
                                                    }
                                                    
                                                            //echo ("<option value='" . $doc["ide_doc"] . "'>");
                                                        ?>


                                                </td>   
                                            </tr>
                                            <?php
                                        }
                                    }
                                    ?>
                                </tbody>
                            </table> 
                          <table >
                                <tbody>
                                    <tr>
                                        <td>
                                            <div class="control-group">
                                            <label class="control-label" for="input02">Costo Materias Teoricas</label>
                                            <div class="controls">
                                                <input type="text" class="input-medium span1"  id="idcosto_teoricas" name="costo_teoricas" value="<?php echo ($valor_teoricas); ?>" >

                                            </div>

                                        </div>                                            
                                        </td>
                                        <td>
                                        <div class="control-group">
                                        <label class="control-label" for="input02">Costo Materias Practicas</label>
                                        <div class="controls">
                                            <input type="text" class="input-medium span1"  id="idcosto_practicas" name="costo_practicas" value="<?php echo ($valor_practicas); ?>" >
                                           <!-- <a href="<?php echo base_url() . "admin.php/pagotodos/ingresodatos" ?>">cambiar </a> -->
                                        </div>

                                        </div>                                            
                                        </td>
                                    </tr>
                                </tbody>
                            </table> 



                        </div>     
                    
                    <?php //if ($ver_inscrip==1){?>
                    <!-- <div class="control-group">
                        <label class="control-label" for="input02">Costo por Inscripcion</label>
                        <div class="controls">
                            <input type="text" id="valor_ins" class="input-medium span1"  name="monto_canc_ins" value="" >
                        </div>
                    </div> -->
                    <?php //}else{?>
                    <!-- <input type="hidden" name="monto_canc_ins" value=0> -->
                    
                    <?php //}?>
                    
                    
                    <div class="control-group">
                        <label class="control-label" for="input02">Costo por <?php echo $titulo;?>
                            </label>
                        <div class="controls">
                            <input type="text" readonly="true" class="input-medium span1"  id="idcosto_conval" name="costo_materias_conv_mat" value="<?php echo ($total_teoricas_conv+$total_practicas_conv); ?>" >
                            <input type="button" onclick="mostrar_tabla()" id="ver_tabla" value="Mostrar">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input02">Costo Semestre</label>
                        <div class="controls">
                            <?php if ($ins['modo_mat'] != 4) { ?>
                                <input type="text" class="input-medium span2"  id="costo_l" name="costo_lec" value="<?php echo $costo_lec ?>" >
                            <?php } else { ?>
                                <!--<input type="text" class="input-medium span2"  id="costo_l" name="costo_lec" value="<?php echo ($costo_lec + ($total_teoricas + $total_practicas)) ?>" > -->
                                <input type="text" class="input-medium span2"  id="costo_l" name="costo_lec" value="<?php echo ($costo_lec ) ?>" >
                            <?php } ?>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input02">Recargo</label>
                        <div class="controls">
                            <input type="text" class="input-medium span1"  id="rcargo" name="recargo" value="<?php 
                                 if ($total_teoricas_conv >0 || $total_practicas_conv>0 ) { 
                                     $recargo2=round(($inscrito[0]['tipo_matr'] == 1 ? 0
                                         : ($inscrito[0]['tipo_matr'] == 2 ? (($total_teoricas_conv+$total_practicas_conv) * 0.1) 
                                                : (($total_teoricas_conv+$total_practicas_conv) * 0.2) )), 2);
                                        //echo ($total_teoricas_conv+$total_practicas_conv);
                                 }else { 
                                        $recargo2=round(($inscrito[0]['tipo_matr'] == 1 ? 0
                                         : ($inscrito[0]['tipo_matr'] == 2 ? (($total_teoricas + $total_practicas) * 0.1) 
                                                : (($total_teoricas + $total_practicas) * 0.2) )), 2);

                                 }
                           echo ($recargo+$recargo2);?>" >

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input02">Valor Beca</label>
                        <div class="controls">
                        <?php
                        if ($inscrito[0]['forma_pago'] == 3) {
                            //echo ("<option value='3'" . ($forma_pago == 3 ? ' selected' : ' ') . ">BECA DEL100%</option>");
                            echo ("<input type='text' class='input-medium span1'  id='idbeca' name='monto_beca' value=" . ($costo_lec) . " disabled /> ");
                        } elseif ($inscrito[0]['forma_pago'] == 4) {
                            echo ("<input type='text' class='input-medium span1'  id='idbeca' name='monto_beca' value=" . ($costo_lec * 0.75) . " disabled /> ");
                        } elseif ($inscrito[0]['forma_pago'] == 5) {
                            echo ("<input type='text' class='input-medium span1'  id='idbeca' name='monto_beca' value=" . ($costo_lec * 0.5) . " disabled /> ");
                        } elseif ($inscrito[0]['forma_pago'] == 6) {
                            echo ("<input type='text' class='input-medium span1'  id='idbeca' name='monto_beca' value=" . ($costo_lec * 0.25) . " disabled /> ");
                        } else {
                            echo ("<input type='text' class='input-medium span1'  id='idbeca' name='monto_beca' value='0' disabled /> ");
                        }
                        ?>



                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="input02">Descuento</label>
                        <div class="controls">
                            <input type="text" class="input-medium span1"  id="desc" name="descuento_mat" value="0" >

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input11">FORMA DE PAGO </label>
                        <div class="controls">
                            <select id="forma_pago" name="forma_pago" ONCHANGE="javascript:ocultar_mostrar_fin(this.options[this.selectedIndex].value)">
                                        <?php
                                        if ($inscrito[0]['forma_pago'] == 3) {
                                            echo ("<option value='3'" . ($forma_pago == 3 ? ' selected' : ' ') . ">BECA DEL100%</option>");
                                        } elseif ($inscrito[0]['forma_pago'] == 4) {
                                            echo ("<option value='4'>BECA DEL 75% Financiado</option>");
                                            echo ("<option value='8'>BECA DEL 75% Contado</option>");
                                            
                                        } elseif ($inscrito[0]['forma_pago'] == 5) {
                                            
                                            echo ("<option value='5' >BECA DEL 50% Financiado</option>");
                                            echo ("<option value='9'>BECA DEL 50% Contado</option>");
                                            
                                        } elseif ($inscrito[0]['forma_pago'] == 6) {
                                            echo ("<option value='6' >BECA DEL 25% Financiado</option>");
                                            echo ("<option value='10' >BECA DEL 25%  Contado</option>");
                                        } else {
                                            echo ("<option value='1'" . ($forma_pago == 1 ? ' selected' : ' ') . ">CONTADO</option>");
                                            echo ("<option value='2'" . ($forma_pago == 2 ? ' selected' : ' ') . ">IECE-CONTADO</option>");
                                            echo ("<option value='11'" . ($forma_pago ==11 ? ' selected': ' ') . ">IECE-FINANCIADO</option>");
                                            echo ("<option value='7'" . ($forma_pago == 7 ? ' selected' : ' ') . ">FINANCIADO</option>");
                                        }
                                        ?>


                            </select>


                        </div>
                    </div>
                        <div class="control-group">
                            <label class="control-label" for="input31">TIPO DE DOCUMENTO</label>
                            <div class="controls">
                                <select id="tipo_doc_pago_mat" name="tipo_doc_pago_mat" ONCHANGE="javascript:ocultar_mostrar_doc(this.options[this.selectedIndex].value)">
                                  
                                    <option value="1" >EFECTIVO</option>
                                    <option value="2" >CHEQUE</option>
                                    <option value="3" >DEPOSITO</option>
                                    <option value="4" >TARJETA</option>
                                    <option value="5" >EFECTIVO-CHEQUE</option>
                                    <option value="6" >EFECTIVO-DEPOSITO</option>
                                    <option value="7" >EFECTIVO-TARJETA</option>


                                </select>


                            </div>
                        </div>
                        <div id="panel1" style="display: none;">

                            <input type="hidden" name="nom_doc_pago_mat1" value="EFECTIVO">
                            <input type="hidden" name="nro_comp_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="lote_doc_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="ref_doc_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="monto_efec_doc_pago1" value="0">
                            <input type="hidden" name="monto_rest_doc_pago1" value="0">
                            
                        </div>
                        <div id="panel2" style="display: none;border: 1px solid #d0d0d0;">

                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DEL BANCO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nom_doc_pago_mat2" value="" >

                                </div>
                            </div>  

                            <div class="control-group">
                                <label class="control-label" for="input02">NRO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="nro_comp_pago_mat2" value="" >

                                </div>
                            </div>
                            <input type="hidden" name="lote_doc_pago_mat2" value="NINGUNO">
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat2" value="" >

                                </div>
                            </div> 
                            <input type="hidden" name="monto_efec_doc_pago2" value="0">
                            <input type="hidden" name="monto_rest_doc_pago2" value="0">
                            
                            

                        </div>

                        <div id="panel3" style="display: none;border: 1px solid #d0d0d0;" >


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO DE LA CUENTA</label>
                                <div class="controls">
                                    <select  id="select01"  class="span3" name="nom_doc_pago_mat3">
                        <?php
                        $ci->load->model('Institucion_Model');
                        $cuentas = $ci->Institucion_Model->getCuentasInstitucionNombre("INSTITUTO TECNOLOGICO SUPERIOR SUDAMERICANO LOJA");
                        foreach ($cuentas as $k => $cuenta) {
                            echo ("<option value='" . $cuenta["cuenta1_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta1_inst"]? " selected" : " "))."/>");
                            echo ($cuenta["cuenta1_inst"] . "-" . $cuenta["banco1_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta2_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta2_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta2_inst"] . "-" . $cuenta["banco2_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta3_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta3_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta3_inst"] . "-" . $cuenta["banco3_inst"] . "</option>");
                        }
                        ?>

                                    </select>

                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input01">NRO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat3" value="" >

                                </div>
                            </div>  
                            <input type="hidden" name="lote_doc_pago_mat3" value="NINGUNO">
                            <input type="hidden" name="monto_efec_doc_pago3" value="0">
                            <input type="hidden" name="monto_rest_doc_pago3" value="0">
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat3" value="" >

                                </div>
                            </div>  
                        <div class="control-group">
                            <label class="control-label" for="select012">FECHA DEL DEPOSITO</label>
                            <div class="controls">

                                <input type="text" class="input-medium "  id="datepicker2" name="fechadep_doc_pago_mat1" value="<?php echo date("m/d/Y"); ?>" >

                            </div>
                        </div>

                            <input type="hidden" name="monto_efec_doc_pago4" value="0">
                            <input type="hidden" name="monto_rest_doc_pago4" value="0">
                            
                            </div>
                            <div id="panel4" style="display: none;border: 1px solid #d0d0d0;">
                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DE LA TARJETA</label>
                                <div class="controls">
                                    <select id="select01"  name="nom_doc_pago_mat4">

                                        <option value="MASTER CARD" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "MASTER CARD"? " selected" : " ")); ?>>MASTER CARD</option>
                                        <option value="DINERS CLUB" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "DINERS CLUB"? " selected" : " ")); ?> >DINERS CLUB</option>
                                        <option value="AMERICAN EXPRESS" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "AMERICAN EXPRESS"? " selected" : " ")); ?>>AMERICAN EXPRESS</option>
                                        <option value="VISA BANCO AUSTRO" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO AUSTRO"? " selected" : " ")); ?>>VISA BANCO AUSTRO</option>
                                        <option value="VISA BANCO MACHALA" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO MACHALA"? " selected" : " ")); ?>>VISA BANCO MACHALA</option>
                                    </select>
                                </div>
                            </div>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO TARJETA</label>

                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat4" value="" >

                                </div>
                            </div>



                            <div class="control-group">
                                <label class="control-label" for="input02">LOTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="lote_doc_pago_mat4" value="" >

                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat4" value="" >

                                </div>
                            </div> 
                            <input type="hidden" name="monto_efec_doc_pago4" value="0">
                            <input type="hidden" name="monto_rest_doc_pago4" value="0">

                        </div>
                        <div id="panel5" style="display: none;border: 1px solid #d0d0d0;">

                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DEL BANCO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nom_doc_pago_mat5" value="" >

                                </div>
                            </div>  

                            <div class="control-group">
                                <label class="control-label" for="input02">NRO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="nro_comp_pago_mat5" value="" >

                                </div>
                            </div>
                            <input type="hidden" name="lote_doc_pago_mat5" value="NINGUNO">
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat5" value="" >

                                </div>
                            </div> 
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago5" value="0" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago5" value="0" >

                                </div>
                            </div>    


                        </div>

                        <div id="panel6" style="display: none;border: 1px solid #d0d0d0;" >


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO DE LA CUENTA</label>
                                <div class="controls">
                                    <select  id="select01"  class="span3" name="nom_doc_pago_mat6">
                        <?php
                        $ci->load->model('Institucion_Model');
                        $cuentas = $ci->Institucion_Model->getCuentasInstitucionNombre("INSTITUTO TECNOLOGICO SUPERIOR SUDAMERICANO LOJA");
                        foreach ($cuentas as $k => $cuenta) {
                            echo ("<option value='" . $cuenta["cuenta1_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta1_inst"]? " selected" : " "))."/>");
                            echo ($cuenta["cuenta1_inst"] . "-" . $cuenta["banco1_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta2_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta2_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta2_inst"] . "-" . $cuenta["banco2_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta3_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta3_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta3_inst"] . "-" . $cuenta["banco3_inst"] . "</option>");
                        }
                        ?>

                                    </select>

                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input01">NRO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat6" value="" >

                                </div>
                            </div>  
                            <input type="hidden" name="lote_doc_pago_mat6" value="NINGUNO">
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat6" value="" >

                                </div>
                            </div> 
                        <div class="control-group">
                            <label class="control-label" for="select012">FECHA DEL DEPOSITO</label>
                            <div class="controls">

                                <input type="text" class="input-medium "  id="datepicker3" name="fechadep_doc_pago_mat2" value="<?php echo date("m/d/Y"); ?>" >

                            </div>
                        </div>
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago6" value="0" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago6" value="0" >

                                </div>
                            </div>    
                            
                            
                            </div>
                            <div id="panel7" style="display: none;border: 1px solid #d0d0d0;">
                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DE LA TARJETA</label>
                                <div class="controls">
                                    <select id="select01"  name="nom_doc_pago_mat7">

                                        <option value="MASTER CARD" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "MASTER CARD"? " selected" : " ")); ?>>MASTER CARD</option>
                                        <option value="DINERS CLUB" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "DINERS CLUB"? " selected" : " ")); ?> >DINERS CLUB</option>
                                        <option value="AMERICAN EXPRESS" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "AMERICAN EXPRESS"? " selected" : " ")); ?>>AMERICAN EXPRESS</option>
                                        <option value="VISA BANCO AUSTRO" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO AUSTRO"? " selected" : " ")); ?>>VISA BANCO AUSTRO</option>
                                        <option value="VISA BANCO MACHALA" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO MACHALA"? " selected" : " ")); ?>>VISA BANCO MACHALA</option>
                                    </select>
                                </div>
                            </div>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO TARJETA</label>

                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat7" value="" >

                                </div>
                            </div>



                            <div class="control-group">
                                <label class="control-label" for="input02">LOTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="lote_doc_pago_mat7" value="" >

                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat7" value="" >

                                </div>
                            </div>  
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DE LA TARJETA</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago7" value="0" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago7" value="0" >

                                </div>
                            </div>    
                                
                        </div>


                        <?php if($forma_pago==1 ||$forma_pago==2 || $forma_pago==3 ){?>
                        <div id="panel_pagoi1" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel_pagoi1" style="display: none;">
                        <?php }?>
                            <div class="control-group">
                                <label class="control-label" for="input03">Costo por Arrastre/Materias</label>
                                <div class="controls">
                                <?php if ($total_teoricas_conv >0 || $total_practicas_conv>0 ) { ?>
                                    <input type="number" step="0.01" class="input-medium span2" id ="idcosto_arrastre" name="costo_arrastre" value="<?php echo ($total_teoricas_conv+$total_practicas_conv); ?>">
                                <?php } else { ?>
                                    <input type="text" class="input-medium span2"   id ="idcosto_arrastre" name="costo_arrastre" value="<?php echo ($total_teoricas + $total_practicas); ?>">
                                <?php } ?>
                                    
                                    

                                </div>
                            </div>   
                            

                        <div class="control-group">
                            <label class="control-label" for="input02">PAGO INICIAL</label>
                            <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"  id="pago_i" name="monto_canc_matr" value=""
                                           onkeyup="calculasaldo()">
                                    <input type="hidden" id="pago_ac" name="pago_ac" value="0">
                                           
                                    <input type="button" onclick="pagoinicial(document.getElementById('pago_i'))" value="Calcular">
                            </div>
                            
                        </div>
                        </div>
                        <?php if($forma_pago==4 ||$forma_pago==5 || $forma_pago==6 || $forma_pago==7 || $forma_pago==11 ){?>
                        <div id="panel_pagoi2" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel_pagoi2" style="display: none;">
                        <?php }?>
                        <div class="control-group">
                            <label class="control-label" for="input02">PAGO INICIAL</label>
                            <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"  id="pago_i1" name="monto_canc_matr1" value="" >

                            </div>
                            
                        </div>
                            
                            
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="input02">HOJA MEMBRETADA</label>
                            <div class="controls">
                              <input type="number" step="0.01" class="input-medium span1"  id="hoja" name="hoja_valor_lec" value="2" >
                              <input type="checkbox" name="chkhoja" value="ON" />Incluir 


                            </div>
                        </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="input02">OBSERVACION PAGO</label>
                        <div class="controls">
                            <textarea class="input-xxlarge" id="idobserv_pago" name="observ_pago" rows="2" value=""><?php echo (!isset($observ_pago)?"NINGUNA":$observ_pago); ?></textarea>

                        </div>
                    </div>
                        <div class="control-group">
                            <label class="control-label" for="input02">Beneficio</label>
                            <div class="controls">
                                    <select id="select01"  name="beneficio_mat">
                                        <option value="0" selected>NINGUNO</option>
                                        <option value="1" >SEGURO ESTUDIANTIL</option>
                                        <option value="2" >INSTITUCIONAL</option>
                                    </select>


                            </div>
                        </div>

                            
                    <div class="control-group">
                        <label class="control-label" for="input02">SALDO A FAVOR</label>
                        <div class="controls">
                          <input type="number" step="0.01" class="input-medium span1"  id="saldo" name="saldo_favor_mat" value="0" >

                        </div>
                    </div>


                        <?php if($forma_pago==4 ||$forma_pago==5 || $forma_pago==6 || $forma_pago==7 || $forma_pago==11){?>
                        <div id="panel_financia" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel_financia" style="display: none;">
                        <?php }?>
                        <div id="panelfinanciasemestre" style="border: 1px solid #d0d0d0;">
                        <table border="0">
                            <tbody>
                                <tr>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Valor Financiado del Semestre</label>
                                            <div class="controls">

                                                <input type="number" step="0.01" class="input-medium span2"  id="finan1" name="valor_financiar1"  value="0" >

                                                <input type="button" onclick="sumaItems()" value="Verifica">


                                            </div>
                                        </div></td>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Nro Pagos</label>
                                            <div class="controls">
                                                <input type="number" class="input-medium span1"  id="nroplans" name="nro_cuotas_plan1" value="3" >
                                                <input type="button" name="boton1" onclick="recalplans()" value="Cuotas">

                                            </div>

                                        </div></td>
                                </tr>
                            </tbody>
                          
                        </table>
                        </div>
                        <div id="panelfinanciarrastre" style="border: 1px solid #d0d0d0;">
                            

                        <table border="0">
                            <tbody>
                                <tr>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Pago Inicial por Arrastres</label>
                                            <div class="controls">
                                                    <input type="number" step="0.01" class="input-medium span1" id="parrastre" name="pago_inicial" value="0" >
                                                    <input type='button' name="boton2" onclick='calcular_arrastres()' value='calc'>


                                            </div>
                                        </div></td>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Valor </label>
                                            <div class="controls">
                                                <input type="number" class="input-medium span1"  id="valarrastre" name="incr_decre_plan" value="0" >
                                   <select id="idtipo_incre"  name="tipo_incre_plan" class="span1">

                                        <option value="0" selected>NING</option>
                                        <option value="1">INCR</option>
                                        <option value="2">DECR</option>
                                    </select>

                                                
                                                <input type='button' name="boton21" onclick='incre_descr()' value='calc'>

                                            </div>

                                        </div></td>
                                </tr>
                                
                                <tr>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Valor Financiado por Arrastres/Materias</label>
                                            <div class="controls">
                                                <?php if ($total_teoricas_conv >0 || $total_practicas_conv>0 ) { ?>
                                                    <input type="number" step="0.01" class="input-medium span2" id="finan2" name="valor_financiar2" value="<?php 
                                                        echo ($total_teoricas_conv+$total_practicas_conv); ?>" >
                                                <?php } else { ?>
                                                    <input type="number" step="0.01" class="input-medium span2" id="finan2" name="valor_financiar2" value="<?php 
                                                        echo ($total_teoricas + $total_practicas); ?>" >
                                                <?php } ?>


                                            </div>
                                        </div></td>
                                    <td><div class="control-group">
                                            <label class="control-label" for="input02">Nro Pagos</label>
                                            <div class="controls">
                                                <input type="number" class="input-medium span1"  id="nroplana" name="nro_cuotas_plan2" value="0" >
                                                <input type='button' name="boton2" onclick='recalplana()' value='Coutas'>

                                            </div>

                                        </div></td>
                                </tr>
                            </tbody>
                        </table>
                        </div>

                        </div>
                       <?php if($forma_pago==4 ||$forma_pago==5 || $forma_pago==6 || $forma_pago==7 || $forma_pago==11){?>
                        <div id="panel_coutas" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel_coutas" style="display: none;">
                        <?php }?>
 
                    
                    
                            <table class="table table-bordered table-striped table-condensed">
                                <tbody>
                                    <tr>
                                        <td>NUMERO DE CREDITO</td>
                                        <td colspan="3">&nbsp;&nbsp;</td>
                                    </tr>

                                    <tr>
                                        <td>CUOTAS</td>
                                        <td>PAGO CUOTAS DEL SEMESTRE</td>
                                        <td>PAGO CUOTAS DE ARRASTRE</td>
                                    </tr>
                                    <?php for ($fil = 1; $fil < 8; $fil++) { ?>
                                        <tr>
                                            <td><?php
                                                echo ($fil == 1 ? "PRIMERA" : ($fil == 2 ? "SEGUNDA" :
                                                                ($fil == 3 ? "TERCERA" : ($fil == 4 ? "CUARTA" : ($fil == 1 ? "QUINTA" :
                                                                                        ($fil == 6 ? "SEXTA" : "SEPTIMA"))))));
                                                ?></td>

                                            <td><input type="number" step="0.01" class="input-medium span2"  id="plans<?php echo($fil) ?>" name="couta<?php echo($fil) ?>_plan_s" value="0" ></td>
                                            <td><input type="number" step="0.01" class="input-medium span2"  id="plana<?php echo($fil) ?>" name="couta<?php echo($fil) ?>_plan_a" value="0" ></td>

                                        </tr>
                                    <?php } ?>





                                </tbody>
                            </table>
                        </div>
                            
                            
                       







                </div>  <!--fin tabulador 3 -->
            </div>
        </div>
        <?php 
            $concepto=($ins['cancela_ins']==0?", PAGO DE INSCRIPCION":""). " " .($recargo>0?", PAGO DE RECARGO":"");
             ?>
            <input type="hidden" name="concepto" value="<?php echo $concepto; ?>">
                            
        <?php if (isset($msj_error)) { ?>
            <div class='MensajeError'>
                <?php echo ($msj_error); ?>
            </div>
        <?php } ?>




        <div class="controls">
                <button type="button" class="btn" onclick="forma.submit()">Grabar Pagos</button>
                <!--<input type="hidden" name="nro_credito" value="<?php echo $nro_credito; ?>"> -->

            <a href="<?php echo base_url() . "admin.php/pagotodos/inicio" ?>">
                <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>

        </div> 



    </form>
<!-- </div>
</div> -->
